package minidb.type;

public class StringConstant implements Constant{
	private String val;
	
	public StringConstant(){
		this.val = "";
	}
	public StringConstant(String val){
		this.val = val;
	}
	
	public Object toVal(){
		return this.val;
	}

	public boolean equals(Object obj) {
		StringConstant ic = (StringConstant) obj;
		return ic != null && val.equals(ic.val);
	}

	public int compareTo(Constant c) {
		StringConstant ic = (StringConstant) c;
		return val.compareTo(ic.val);
	}

	public int hashCode() {
		return val.hashCode();
	}

	public String toString() {
		return val.toString();
	}

	public Boolean isNull() {
		return val.compareTo("")==0;
	}
}
